﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RedDragon.Common.Domain.Enterprise
{
    /// <summary>
    /// 企业表 
    /// </summary>
    public class Enterprises
    {
        /// <summary>
        /// 企业ID(序号)
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//IsPrimaryKey 主键 IsIdentity 自增
        public int EnterpriseId { get; set; }

        /// <summary>
        /// 企业名称
        /// </summary>
        [SugarColumn(ColumnDataType = "NVarchar(200)", IsNullable = true)]//设置长度 IsNullable可空
        public string EnterpriseName { get; set; }

        /// <summary>
        /// 企业简称
        /// </summary>
        [SugarColumn(ColumnDataType = "NVarchar(100)", IsNullable = true)]//设置长度 IsNullable可空
        public string EnterpriseAbbreviation { get; set; }

        /// <summary>
        /// 注册地址
        /// </summary>
        [SugarColumn(ColumnDataType = "NVarchar(200)", IsNullable = true)]//设置长度 IsNullable可空
        public string Address { get; set; }

        /// <summary>
        /// 法定代表人
        /// </summary>
        [SugarColumn(ColumnDataType = "NVarchar(50)", IsNullable = true)]//设置长度 IsNullable可空
        public string LegalRepresentative { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(ColumnDataType = "NVarchar(50)", IsNullable = true)]//设置长度 IsNullable可空
        public string Phone { get; set; }

        /// <summary>
        /// 电子邮件
        /// </summary>
        [SugarColumn(ColumnDataType = "NVarchar(50)", IsNullable = true)]//设置长度 IsNullable可空
        public string Email { get; set; }

        /// <summary>
        /// 成立日期
        /// </summary>
        [SugarColumn(IsNullable = true)]//IsNullable可空
        public DateTime EstablishmentDate { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(IsNullable = true)]//IsNullable可空
        public DateTime? TurnoverTime { get; set; }

        /// <summary>
        /// 部门上级
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 是否删除 1-未删除 2-已删除
        /// </summary>
        public int IsDeleted { get; set; }

        /// <summary>
        /// 子级
        /// </summary>
        [SugarColumn(IsIgnore = true)] //IsIgnore 被忽略 不会迁移到数据库
        public List<Enterprises> Children { get; set; }
    }
}
